/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://github.com/mineadmin
 */
import type { MaFormItem } from "@mineadmin/form";
import hasAuth from "@/utils/permission/hasAuth.ts";
import MaUploadFile from "@/components/ma-upload-file/index.vue";
import MaDictSelect from "@/components/ma-dict-picker/ma-dict-select.vue";
import { concat } from "lodash-es";

export default function getFormItems(
  formType: "add" | "edit" = "add",
  t: any,
  model: any
): MaFormItem[] {
  return concat([
    {
      label: "录像文件地址",
      prop: "file_url",
      render: () => MaUploadFile,
      renderProps: {
        placeholder: t("form.pleaseInput", { msg: "录像文件地址" }),
        title: "选择视频文件",
        fileType: ["mp4", "avi", "mov", "wmv", "flv", "mkv", "webm", "m4v"],
        fileSize: 100 * 1024 * 1024, // 100MB
        limit: 1,
        multiple: false,
      },
      multiple: false,
    },
    {
      label: "关联的预警数据id",
      prop: "yj_data_id",
      render: () => MaDictSelect,
      renderProps: { multiple: false },
    },
  ]);
}
